<?php
/**
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/7/25 0025
 * Time: 14:34
 */

namespace app\storage\model;


use think\Model;

class SmtOutflowModel extends Model
{
    protected $table = 'smt_outflow';
    protected $pk = 'uuid';
    public function getSmtOutflow($condition){
        $where = $condition['where'];
        $pageIndex = $condition['pageIndex'];
        $pageSize = $condition['pageSize'];
        $ret['total'] = $this->where($where)
            ->join(['iwh_storage' => 'storage'], 'storage.uuid = storage_uuid')
            ->count();
        $ret['row'] = $this->where($where)
            ->join(['iwh_storage' => 'storage'], 'storage.uuid = storage_uuid')
            ->order('time desc')
            ->page($pageIndex,$pageSize)
            ->select();
        return $ret;

    }


}